package com.canaan.business.common.enums.inOutStock;

/**
 * 出库类型枚举
 */
public enum OutStockOrderTypeEnum {
    SALES(1, "销售出库"),
    PICK(2, "领料出库"),
    ADJUST(3, "调拔出库"),
    OTHER(4, "其他出库"),
    RETURN(5, "退货出库"),
    MP(6, "备料拣货"),
    ;

    private final Integer code;
    private final String message;

    OutStockOrderTypeEnum(Integer code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        if(code == null){
            return null;
        }
        String message = null;
        for (OutStockOrderTypeEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
